//
//  CXTempController.swift
//  Project03-Weibo-swift
//
//  Created by w on 16/1/18.
//  Copyright © 2016年 w. All rights reserved.
//

import UIKit

class CXTempController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        setupUI()
    }
    
    func setupUI() {
///  设置title，view的背景颜色、设置barButtonItem
        let titleStr = "当前第\((navigationController?.viewControllers.count ?? 0) - 1)个控制器"
        navigationItem.title = titleStr
        
        view.backgroundColor = UIColor.purpleColor()
        
        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "push", target: self, action: "push")
    }
    
    @objc private func push() {
        navigationController?.pushViewController(CXTempController(), animated: true)
    }
}
